Rocky Linux 9.2 配置Clash科学上网 |
您所在的位置:网站首页 › clash 安装Linux › Rocky Linux 9.2 配置Clash科学上网 |
![]() 本次部署Clash是在Rocky Linux系统中,我们从github上去下载对应的版本(clash-linux-amd64-v1.18.0.gz)并将下载的文件命名为clash.gz wget -O clash.gz https://github.com/Dreamacro/clash/releases/download/v1.18.0/clash-linux-amd64-v1.18.0.gz将下载到本地的安装包解压缩到/usr/local/bin目录下 gzip -dc clash.gz > /usr/local/bin/clash chmod +x /usr/local/bin/clash新建配置文件存放目录,并下载MMDB文件 mkdir /etc/clash wget -O /etc/clash/Country.mmdb https://github.com/Dreamacro/maxmind-geoip/releases/download/20231012/Country.mmdb将clash设置为系统服务,将下面的脚本文件存储到此路径中/etc/systemd/system/clash.service [Unit] Description=clash daemon [Service] Type=simple User=root ExecStart=/usr/local/bin/clash -d /etc/clash/ Restart=on-failure [Install] WantedBy=multi-user.target重新加载使其生效 systemctl daemon-reload 配置科学上网下载并导入已有的订阅链接并将配置文件重命名为config.yaml wget -O /etc/clash/config.yaml [订阅链接]添加如下内容配置文件到/etc/profile.d/proxy.sh路径中 export http_proxy="127.0.0.1:7890" export https_proxy="127.0.0.1:7890" export no_proxy="localhost, 127.0.0.1" # 此处增加服务器IP用于页面访问重新加载配置文件 source /etc/profile启动clash服务并设置自动启动 systemctl start clash systemctl enable clash查看clash服务状态 systemctl status clash 配置clash Web UI从github上克隆clash-dashboard到本地 git clone -b gh-pages --depth 1 https://github.com/Dreamacro/clash-dashboard /opt/clash-dashboard修改clash配置文件中的external-ui的路径为/opt/clash-dashboard sed -i "s/^#{0,1} {0,1}external-ui.*/external-ui: /opt/clash-dashboard/" /etc/clash/config.yaml重启clash服务 systemctl restart clash clash Web UI访问通过浏览器访问服务器IP:9090/ui.服务器IP为clash IP。在浏览器中可以选择合适的节点。 此文章为原创文章,作者:胖哥叨逼叨,如若转载,请与我联系并注明出处:https://www.pangshare.com/2824.htm |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |